package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.GaussianBlurExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 高斯模糊算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建GaussianBlurExecutor实例
 */
public class GaussianBlurExecutorFactory implements AlgorithmExecutorFactory {
    private static final GaussianBlurExecutorFactory instance = new GaussianBlurExecutorFactory();

    private GaussianBlurExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return GaussianBlurExecutorFactory实例
     */
    public static GaussianBlurExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        GaussianBlurExecutor gaussianBlurExecutor = new GaussianBlurExecutor();
        BeanUtils.copyProperties(param, gaussianBlurExecutor);
        return gaussianBlurExecutor;
    }
}